<%@ page import="com.xinjie.www.service.post.PostServiceImpl" %>
<%@ page import="com.xinjie.www.po.Post" %>
<%@ page import="java.sql.SQLException" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>被举报的帖子详情</title>
    <style type="text/css">
        table {
            width: 100%;
            border: 1px solid red;
            border-collapse: collapse;
        }

        th, td {
            border: 1px solid red;
        }
    </style>
</head>
<body>
<%
    int id = Integer.parseInt(request.getParameter("postId"));
    String tieba = request.getParameter("tieba");
    PostServiceImpl postService = new PostServiceImpl();
    Post post = null;
    try {
        post = postService.getPost(id);
    } catch (SQLException | ClassNotFoundException e) {
        e.printStackTrace();
    }
%>
<div align="center">
    <table>
        <tr>
            <th>主题</th>
            <th>所属贴吧</th>
            <th>内容</th>
            <th>作者</th>
            <th>评论数</th>
            <th>点赞数</th>
            <th>发布时间</th>
            <th></th>
        </tr>
        <tr>
            <%="<td>" + post.getTitle() + "</td>"%>
            <%="<td>" + post.getTieba() + "</td>"%>
            <%="<td>" + post.getContent() + "</td>"%>
            <%="<td>" + post.getWriter() + "</td>"%>
            <%="<td>" + post.getComment() + "</td>"%>
            <%="<td>" + post.getThumb() + "</td>"%>
            <%="<td>" + post.getTime() + "</td>"%>
            <%
                int post_id = post.getPostId();
                String from = "report";
            %>
            <td><a href="DeletePost.jsp?id=<%=post_id%>&tiebaName=<%=tieba%>&from=<%=from%>">有违规言论去进行删除</a> </td>
        </tr>
    </table>
    <%if (request.getSession().getAttribute("deletePostSuccess") != null) {%>
    <%=request.getSession().getAttribute("deletePostSuccess")%>
    <%request.getSession().removeAttribute("deletePostSuccess");%>
    <%}if (request.getSession().getAttribute("deletePostLose") != null) {%>
    <%=request.getSession().getAttribute("deletePostLose")%>
    <%request.getSession().removeAttribute("deletePostLose");%>
    <%}%>
    <a href="LookReport.jsp?tieba=<%=tieba%>">返回</a>
</div>
</body>
</html>
